package com.epfly.sdk.promo.activity;

import com.epfly.base.vo.BaseResp;
import com.epfly.base.vo.PageResp;
import com.epfly.base.vo.RowsResp;
import com.epfly.iface.promo.activity.ActivityURL;
import com.epfly.iface.promo.activity.vo.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;


/**
 * Feign的入参 == 接口入参 ==控制器入参
 */
@FeignClient(value = "ifood-promo", contextId = "ActivityServiceFeign")
interface ActivityServiceFeign {


    @PostMapping(value = ActivityURL.ACTIVITY_ADD)
    ResponseEntity<ActivityAddAndUpdateResp> performActivityAdd(@RequestBody ActivityAddAndUpdateRequest activityAddRequest);

    @GetMapping(value = ActivityURL.ACTIVITY_LIST)
    ResponseEntity<PageResp<ActivityListVo>> performActivityList(@SpringQueryMap ActivityListRequest activityListRequest);

    @PostMapping(value = ActivityURL.ACTIVITY_ALTER_ACTIVITY_IS_ACTIVE)
    ResponseEntity<BaseResp> alterActivityIsActive(@RequestBody AlterActivityIsActiveRequest request);

    @PostMapping(value = ActivityURL.ACTIVITY_TERMINATED)
    ResponseEntity<BaseResp> performActivityTerminated(@RequestBody ActivityTerminatedRequest request);

    @PostMapping(value = ActivityURL.ACTIVITY_UPDATE)
    ResponseEntity<BaseResp> performActivityUpdate(@RequestBody ActivityAddAndUpdateRequest activityAddRequest);

    @GetMapping(value = ActivityURL.ACTIVITY_DETAIL)
    ResponseEntity<ActivityDetailResp> performActivityDetail(@RequestParam Long activityId);

    @GetMapping(value = ActivityURL.ACTIVITY_STORE_COUNT)
    ResponseEntity<RowsResp<StoreCountVo>> storeCount(@SpringQueryMap StoreCountRequest request);
}
